<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Insert title here</title>
<link rel="stylesheet" href="<%=basePath%>css/layui/css/layui.css">

<script type="text/javascript" src="<%=basePath%>js/jquery-2.1.0.min.js"></script>
<script type="text/javascript" src="<%=basePath%>js/layer/layer.js"></script>
<script type="text/javascript" src="<%=basePath%>js/index/foodManage.js"></script>
<script type="text/javascript" src="<%=basePath%>js/BaseUtile.js"></script>


 
</head>
<body style="padding: 2%">
	<div>
		<div>
			<b style="font-size: 25px">原料</b> 
			
			<button  class="layui-btn layui-btn-danger" id="inputMaterialButton">新增原料</button>
		</div>
		<div>
			<table class="layui-table">
				<thead>
					<tr>
						<th>序号</th>
						<th>原料名称</th>
						<th>单位</th>
						<th>参考价格</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<c:set var="num" value="1" />
					<c:forEach var="list" items="${materialList}">
						<tr>
							<td><c:out value="${num}" /></td>
							<c:set var="num" value="${num+1}" />
							<td>${list.materialName}</td>
							<td>${list.unit.unitName}</td>
							<td>${list.materialPrice}</td>
							<td><button class="layui-btn"
									onclick="editMaterial(${list.materialId})">编辑</button>
								<button class="layui-btn" onclick="deleteMaterial(${list.materialId})">删除</button></td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
	</div>
	
	
	
	
	
	
</body>
</html>